define([ 'ng', 'common/js/user-module', "common/js/util-module", "ui.router" ],
		function(angular) {

			var app = angular.module("AuthApp", [ 'UserModule', "UtilModule",
					"ui.router" ]);

			app.config(function($stateProvider, $urlRouterProvider) {

				$stateProvider.state("supadmin", {
					url : '/supadmin',
					controller : function($scope, epModal) {

						$scope.$parent.loginInfo.role = "SUPADMIN";

						epModal.open("login");

					}
				});
			});
			app.controller("AuthCtrl",
					function($scope, User, $window, $parse, $http, epModal) {
						$scope.roles = [ "COORDINADOR", "SECRETARIO", "PROFESOR",
								"ACUDIENTE" ];
						$scope.loginInfo = {};
						$scope.logIn = function() {
							User.login({}, $scope.loginInfo, function() {
								$window.location.href = "/";
							}, function(error) {
						epModal.notify(error.data, "error", "center");
							});
						}
						

					});
			return app;
		});
